<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>毕业设计项目</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="../../js/jquery-1.9.0.js"></script>
<link href="../../css/style.css" rel="stylesheet" type="text/css">
<script src="../../script/common.js"></script>

</head>
<body onload="selectCstLinkmanForNo()">

<div class="page_title">客户信息管理 > 客户信息 > 联系人 </div>
<div class="button_bar">
	<button class="common_button" onclick="help('');">帮助</button>
	<button class="common_button" onclick="to('linkman_add.html');">新建</button>
	<button class="common_button" onclick="back();">返回</button>  
</div>
<table class="query_form_table">
	<tr>
		<th>客户编号</th>
		<!--KH071202001-->
		<td id="lkmCustNo"></td>
		<th>客户名称</th>
		<!--聪海信息科技有限公司-->
		<td id="lkmCustName"></td>
	</tr>
	</table>
<br />
<table class="data_list_table">
	<tr>
		<th>姓名</th>
		<th>性别</th>
		<th>职位</th>
		<th>办公电话</th>
		<th>手机</th>
		<th>备注</th>
		<th>操作</th>
	</tr>
	<tbody id="linkmanForNoList">
	</tbody>
	</table>
</body>
</html>
<script type="text/javascript">
    function UrlSearch(){
        var str=location.href; //取得整个地址栏
        var num=str.indexOf("=")
        str=str.substr(num+1); //取得所有参数   stringvar.substr(start [, length ]
		return str;
    }
	function selectCstLinkmanForNo() {
        UrlSearch();
		var custNo=UrlSearch();
        var lkmCustNo;
        var lkmCustName;
        $.ajax({
            url: "/CstLinkman/selectCstLinkmanForNo",
            type: 'GET',
			data:{"lkmCustNo":custNo},
            dataType: 'json',
            contentType: "application/json;charset=utf-8",
            success:function (cstLinkmen) {
                $.each(cstLinkmen,function (i,linkmen) {
                    lkmCustNo=linkmen.lkmCustNo;
                    lkmCustName=linkmen.lkmCustName;
                    var linkmenTR=
                        '<tr>'+
                        '<td class="list_data_text">'+linkmen.lkmName+'</td>'+
                        '<td class="list_data_ltext">'+linkmen.lkmSex+'</td>'+
                        '<td class="list_data_text">'+linkmen.lkmPostion+'</td>'+
                        '<td class="list_data_text">'+linkmen.lkmTel+'</td>'+
                        '<td class="list_data_text">'+linkmen.lkmMobile+'</td>'+
                        '<td class="list_data_op">'+linkmen.lkmMemo+'</td>'+
                        '<td class="list_data_op">'+
						'<a href="linkman_edit.html?lkmId='+linkmen.lkmId+'">' +
						'<img title="编辑" src="../../../images/bt_edit.gif" class="op_button" /></a>'+
                        '<img title="删除" lkmName="'+linkmen.lkmName+'" src="../../../images/bt_del.gif" class="op_button" />'+
                        '</td>'+
                        '</tr>';
                    $("#linkmanForNoList").append(linkmenTR);
                });
                $("#lkmCustNo").append(lkmCustNo);
                $("#lkmCustName").append(lkmCustName);
            }
        });
    }
    $(document).on("click","*[lkmName]",function () {
        var lkmName=$(this).attr("lkmName");
//        alert(lkmName);
		$.ajax({
            url: "/CstLinkman/deleteForName",
            type: 'GET',
            data:{"lkmName":lkmName},
            dataType: 'json',
            contentType: "application/json;charset=utf-8",
            success:function (i) {
				if(i>0){
				    alert("删除成功");
                    window.location.reload();
				}
			}
		})
    });
</script>